let obj = {   //源对象==》易驰衣服
  names: '衣服',
  times: '2018年1月1日',
  str: '这衣服还行'

}
let personZ = new Proxy(obj, {
  get(target, key) {
    if (key == 'times') {
      return false;
    } else {
      return target[key];
    }
  },
  set(target, key, val) {
    if (key == 'str') {
      //可以修改
      return target[key] = val;
    } else {
      //不可以修改
      return target[key];
    }
  },
  deleteProperty(target, key) {
    if (key == 'str') {
      return false;
    } else {
      delete target[key];
    }
  }
})
console.log(personZ.names); //用户操作
console.log(personZ.times);
console.log(personZ.str);

// personZ.names='裤子';
// console.log(personZ.names);

// personZ.str='这衣服不行';
// console.log(personZ.str);

console.log(delete personZ.str);
console.log(personZ);

console.log(delete personZ.str);
console.log(personZ);